<include file="Common:pony" />
<body>
<include file="Common:sellerpanel" />

<table align="right" width="90%">
<tr><td align="left" height="30">
<div>
				<!-- [<a href="<{:U('Index/inventory')}>" target="_blank">同步库存</a>] --> 
<form id="form1" name="form1" method="post" action="<{:U('Index/inventory')}>">
	<input id="btnInventory" name="button1" type="submit" value="同步库存">
	<div style="font-family: 微软雅黑, Tahoma; letter-spacing: 2px; display: none;" id="result"></div>
</form>
			</div>
</td>
</tr>
</table><h1>查看库存</h1>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
		<tr  class="header" height="30">
			<td width="120">名称</td>
			<td width="120">SKU编码</td>
			<td width="120">库存量</td>
		</tr>
		<volist name="proskus" id="vo">
		<php>
		//$proinventory = ( $vo['proinventory'] <= $vo['prolower'] ) ? $vo['proinventory'] : '很多';
		//$proinventory = $vo['proinventory']
		$proinventory = ( $vo['proinventory'] <= $vo['prolower'] ) ? '<span style="color:red">'. $vo['proinventory'] . '</span>' : $vo['proinventory']; 
		</php>
		<tr class="row" height="30">
			<td><{$vo.title}></td>
			<td><{$vo.prosku}></td>
			<td><{$proinventory}></td>
		</tr>
		</volist>
		<tr class="row">
		<td height="30" colspan="4" align="center"><div><{$page}></div></td>
		</tr>
	</table>

</body>
<script>
$('#form1').ajaxForm({
	beforeSubmit : checkForm, // pre-submit callback
	success : complete, // post-submit callback
	dataType : 'json'
});
function checkForm() {
	//可以在此添加其它判断	
	$("#btnInventory").attr( "disabled" , "disabled").val("正在同步库存...");
}
function complete(data) {
	if (data.status == 1) {
		$('#result').html(data.info).show().slideUp(10000);
		
	} else {
		$('#result').html(data.info).show();
	}
	$("#btnInventory").removeAttr( "disabled" ).val("同步库存");
}
</script>
</html>